import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [{
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () =>
                import ( /* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [{
                    // 富文本编辑器组件
                    path: '/unDeliverOrder',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/unDeliverOrder.vue'),
                    meta: { title: '待发货订单' }
                }, {
                    // 富文本编辑器组件
                    path: '/deliveredOrder',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/deliveredOrder.vue'),
                    meta: { title: '已发货订单' }
                }, {
                    // 富文本编辑器组件
                    path: '/unPaymentOrder',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/unPaymentOrder.vue'),
                    meta: { title: '未支付订单' }
                }, {
                    // 富文本编辑器组件
                    path: '/finishOrder',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/finishOrder.vue'),
                    meta: { title: '已完成订单' }
                }, {
                    // 富文本编辑器组件
                    path: '/cloudStocksOrder',
                    component: () =>
                        import ( /* webpackChunkName: "editor" */ '../components/page/cloudStocksOrder.vue'),
                    meta: { title: '代储库订单' }
                },
                {
                    path: '/404',
                    component: () =>
                        import ( /* webpackChunkName: "404" */ '../components/page/404.vue'),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: () =>
                        import ( /* webpackChunkName: "403" */ '../components/page/403.vue'),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: () =>
                import ( /* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});